<?php

require_once('db.php');
require_once('utils.php');

$uid = $_GET['user'];

?>

<!DOCTYPE html 
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es" lang="es">
 <head>
  <title>Sweetter 2.0</title>
  <link rel="stylesheet" type="text/css" href="css/estilo.css" />
  <link rel="icon" href="img/favicon.ico" type="image/vnd.microsoft.icon">
 </head>
 <body>
<?php show_header("Search in Sweetter 2.0"); ?>
   <h3>A qui&eacute;n buscas?</h3>
<?php
if (!empty($error)) {
	echo '<div class="error">'.$error.'</div>';
}
?>

   <form action="search.php" method="get" class="user">
     <label for="user">Usuario:</label><br />
     <input type="text" name="user" value="" id="user"/><br />
     <input type="submit" name="send" value="Buscar" />
   </form>

<?php
if(!empty($uid)){
    print '<div class="box">';
    $q = "select name from users where name like '%". mysql_real_escape_string($uid) ."%'";
    $res = mysql_query($q);
    $i = 0;
    while($value = mysql_fetch_array($res, MYSQL_ASSOC))
        print '@<a href="'.$userURL.$value['name'].'">'.$value['name'].'</a><br/>';
    print '</div>';
}
pie();
?>

 </body>
</html>

